package com.anolesoft.amljmes.fortysix.controller;

import com.anolesoft.amljmes.fortysix.dto.MesBzzBindDto;
import com.anolesoft.amljmes.fortysix.dto.MesBzzZcbldmxDto;
import com.anolesoft.amljmes.fortysix.dto.newDto;
import com.anolesoft.amljmes.fortysix.service.info.MesBzzZcbldmxService;
import com.anolesoft.common.core.constant.HttpStatus;
import com.anolesoft.common.core.domain.LoginUser;
import com.anolesoft.common.core.web.domain.AjaxResult;
import com.anolesoft.common.security.util.SecurityUtils;
import com.anolesoft.yr.util.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("mesbzzZcbldmx")
public class MesBzzZcbldmxController {
    @Autowired
    MesBzzZcbldmxService mesBzzZcbldmxService;
//
//    // 保留单打印(根据保留单主键查询保留单明细)
//    @PostMapping(value="/bldPrint",produces = MediaType.APPLICATION_JSON_VALUE)
//    public AjaxResult queryZcbldmx(@RequestBody String bldobjuid){
//        bldobjuid = bldobjuid.substring(1,bldobjuid.length()-1).replace("\"","'");
//        System.out.println("_________________---------------------"+bldobjuid);
//        List<MesBzzZcbldmxDto> list = mesBzzZcbldmxService.queryZcbldmx(bldobjuid);
//        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,list);
//    }
//
//    // 移交单打印(根据移交单号）
//    @PostMapping(value="/yjdPrint",produces = MediaType.APPLICATION_JSON_VALUE)
//    public AjaxResult queryBindYjd(@RequestBody String yijiaodanhao){
//        yijiaodanhao = yijiaodanhao.substring(1,yijiaodanhao.length()-1).replace("\"","'");
//        System.out.println("_________________---------------------"+yijiaodanhao);
//        List<MesBzzBindDto> list = mesBzzZcbldmxService.queryBindYjd(yijiaodanhao);
//        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,list);
//    }
//    // 补件单打印(根据补件单号）
//    @PostMapping(value="/bjdPrint",produces = MediaType.APPLICATION_JSON_VALUE)
//    public AjaxResult queryBindBjd(@RequestBody String bujiandanhao){
//        bujiandanhao = bujiandanhao.substring(1,bujiandanhao.length()-1).replace("\"","'");
//        System.out.println("_________________---------------------"+bujiandanhao);
//        List<MesBzzBindDto> list = mesBzzZcbldmxService.queryBindBjd(bujiandanhao);
//        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,list);
//    }
//
//    // 状态改为“已注销”
//    @PostMapping(value="/updateStateZx", produces = MediaType.APPLICATION_JSON_VALUE)
//    public AjaxResult updateStateZx(@RequestBody String[] qualifiedLabelNumbers){
//        System.out.println(">>>>>>update");
//        List<String> asList = null;
//        if (qualifiedLabelNumbers != null) {
//            asList = Arrays.asList(qualifiedLabelNumbers);
//        }
//        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,mesBzzZcbldmxService.updateStateZx(asList));
//    }
////    // 计划数量减少
////    @PostMapping(value="/updateBjdh", produces = MediaType.APPLICATION_JSON_VALUE)
////    public AjaxResult updateNumJs(@RequestBody String[] qualifiedLabelNumbers){
////        System.out.println(">>>>>>update");
////        List<String> asList = null;
////        if (qualifiedLabelNumbers != null) {
////            asList = Arrays.asList(qualifiedLabelNumbers);
////        }
////        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,mesBzzZcbldmxService.updateNumJs(asList));
////    }
//
//    // 生成转场保留单
//    @PostMapping(value="/add", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ResponseBody
//    public AjaxResult addMesBzzZcbldmx(@RequestBody MesBzzZcbldmxDto inFoDtoParam){
//        System.out.println(">>>>>>add");
//        LoginUser loginUser = SecurityUtils.getLoginUser();
//        inFoDtoParam.setShenqingren(loginUser.getEmpUid());
//        inFoDtoParam.setShenpiren(loginUser.getEmpUid());
//        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,mesBzzZcbldmxService.addMesBzzZcbldmx(inFoDtoParam));
//    }
//
//    // 根据保留单主键修改保留单明细备注
//    @PostMapping(value="/updateZcbldBz", produces = MediaType.APPLICATION_JSON_VALUE)
//    public AjaxResult updateZcbldBz(@RequestBody newDto dto){
//        System.out.println(">>>>>>update");
//        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,mesBzzZcbldmxService.updateZcbldBz(dto));
//    }
}
